package aiku.numericalcontroloa.Model.Entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName products
 */
@TableName(value ="products")
@Data
public class Products implements Serializable {
    /**
     * 产品ID (主键)
     */
    //自动注入UUID
    @TableId(type = IdType.ASSIGN_UUID)
    private String productsId;

    /**
     * 产品名称
     */
    private String productsName;

    /**
     * 描述
     */
    private String description;

    /**
     * 型号 
     */
    private String model;

    /**
     * 价格
     */
    private BigDecimal price;

    /**
     * 是否含税 
     */
    private Integer isIncludingTax;

    /**
     * 数量
     */
    private Integer number;

    /**
     * 图片
     */
    private String image;

    /**
     * 采购人
     */
    private String purchaser;

    /**
     * 入库时间  
     */
    private Date storageTime;

    /**
     * 结款方式    (1现金
 ,2月结)
     */
    private String paymentType;

    /**
     * 入库状态 （0已通过，1待审核,2审核失败）
     */
    private String status;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Products other = (Products) that;
        return (this.getProductsId() == null ? other.getProductsId() == null : this.getProductsId().equals(other.getProductsId()))
            && (this.getProductsName() == null ? other.getProductsName() == null : this.getProductsName().equals(other.getProductsName()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getModel() == null ? other.getModel() == null : this.getModel().equals(other.getModel()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getIsIncludingTax() == null ? other.getIsIncludingTax() == null : this.getIsIncludingTax().equals(other.getIsIncludingTax()))
            && (this.getNumber() == null ? other.getNumber() == null : this.getNumber().equals(other.getNumber()))
            && (this.getImage() == null ? other.getImage() == null : this.getImage().equals(other.getImage()))
            && (this.getPurchaser() == null ? other.getPurchaser() == null : this.getPurchaser().equals(other.getPurchaser()))
            && (this.getStorageTime() == null ? other.getStorageTime() == null : this.getStorageTime().equals(other.getStorageTime()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getPaymentType() == null ? other.getPaymentType() == null : this.getPaymentType().equals(other.getPaymentType()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getProductsId() == null) ? 0 : getProductsId().hashCode());
        result = prime * result + ((getProductsName() == null) ? 0 : getProductsName().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getModel() == null) ? 0 : getModel().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getIsIncludingTax() == null) ? 0 : getIsIncludingTax().hashCode());
        result = prime * result + ((getNumber() == null) ? 0 : getNumber().hashCode());
        result = prime * result + ((getImage() == null) ? 0 : getImage().hashCode());
        result = prime * result + ((getPurchaser() == null) ? 0 : getPurchaser().hashCode());
        result = prime * result + ((getStorageTime() == null) ? 0 : getStorageTime().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getPaymentType() == null) ? 0 : getPaymentType().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", productsId=").append(productsId);
        sb.append(", productsName=").append(productsName);
        sb.append(", description=").append(description);
        sb.append(", model=").append(model);
        sb.append(", price=").append(price);
        sb.append(", isIncludingTax=").append(isIncludingTax);
        sb.append(", number=").append(number);
        sb.append(", image=").append(image);
        sb.append(", purchaser=").append(purchaser);
        sb.append(", storageTime=").append(storageTime);
        sb.append(", paymentType=").append(paymentType);
        sb.append(", status=").append(status);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}